Skip to content

fix(mediascanner): isolate SkipFilesystemScan scanners to prevent file wipe#536

Merged
wizzomafizzo merged 1 commit intomainfrom
fix/scanner-isolation
Feb 12, 2026
Merged

fix(mediascanner): isolate SkipFilesystemScan scanners to prevent file wipe#536
wizzomafizzo merged 1 commit intomainfrom
fix/scanner-isolation

Conversation

@wizzomafizzo
Copy link
Member

@wizzomafizzo wizzomafizzo commented Feb 12, 2026

Summary

  • Fix: SkipFilesystemScan scanners (e.g. RetroBat, Kodi) now receive nil input and have their results appended to the shared file list, instead of replacing it. This prevents independent scanners that ignore their input from wiping files found by other launchers or the filesystem walk.
  • Regression tests: Added TestNewNamesIndex_IndependentScannerDoesNotWipeFiles (filesystem + independent scanner, verifies both contribute files) and updated TestNewNamesIndex_MixedSkipFilesystemScanAndCustomLauncher with a Scanner that returns empty (exact RetroBat scenario).
  • Diagnostic logging: Added trace-level logging to PathIsLauncher and GetSystemPaths for debugging launcher path resolution.
  • Test coverage: Added TestParseCustomLaunchers_AbsolutePathWithSystemID for custom launcher parsing.

Fixes the bug where RetroBat's scanner wiped custom launcher files during PS2 indexing.

Closes #507 and closes #517

…e wipe

SkipFilesystemScan launchers (e.g. RetroBat, Kodi) generate results
independently and don't filter the shared file list. Previously, the
scanner loop used a pipeline where each scanner's output replaced the
shared files slice. When an independent scanner ignored its input (like
RetroBat's when gamelist.xml is missing), it wiped all files found by
other launchers or the filesystem walk.

Now SkipFilesystemScan scanners receive nil input and their results are
appended, while non-skip scanners retain the existing pipeline behavior.
@sentry
Copy link

sentry bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/database/mediascanner/mediascanner.go 80.95% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@wizzomafizzo wizzomafizzo merged commit 3e819af into main Feb 12, 2026
12 checks passed
@wizzomafizzo wizzomafizzo deleted the fix/scanner-isolation branch February 12, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom launchers not populating media db Custom script detection and execution issues after upgrading to Zaparoo 2.9.0 on Windows

1 participant